<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<style type="text/css">
	.test{
		background-color:#FFFF88;
	}
		.error-msg{
			color:red;
		}
	
</style>

<script type="text/javascript" src="../js/jquery-1.7.1.js"></script>
<script type="text/javascript" src="../js/validator.js"></script>
</head>
<body>
<!--
<p:text validator="xxx" htmAttr="class='test' name='test' style='color:blue'"/><br />
<p:textarea validator="xxx" /><br />
<p:password required="true" /><br />
<p:email required="true" /><br />
-->
<form action="login.do" method="post" onsubmit="return doCheck();" id="loginform">
<p><label>User name:</label><br /><p:text required="true" htmAttr="class='test' id='username' name='username'"/></p>
<p><label>password:</label><br /><p:password required="true" htmAttr="name='password'"/></p>
<input type="submit" value="submit"><input type="reset"
	value="reset"></input>"</form>
	
	<script type="text/javascript">
		$(document).ready(function(){
			av.validation.attach();
			$('#username')[0].focus();
		});

		function doCheck(){
			var hasErr = av.validation.checkValid($('#loginform'));
			if(hasErr){
				alert('canot submit');
				return false;
			}
			return true;
		}
		
	</script>
</body>
</html>